package org.openapplet.tomcat.core;

import java.io.*;
import java.util.ArrayList;
import java.util.List;

public class ReaderResource {
    public static List<String> readHTML(File file){
        List<String> list=new ArrayList<String>();
        BufferedReader bufferedReader=null;
        try {
            bufferedReader=new BufferedReader(new FileReader(file));
            String line=bufferedReader.readLine();
            while(line!=null){
                list.add(line);
                line=bufferedReader.readLine();
            }
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }finally {
            if(bufferedReader!=null){
                try {
                    bufferedReader.close();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }
        return list;
    }
}
